package com.common.rabbitmq.producer.core;

import com.common.handler.ExchangeServiceHandler;
import com.common.rabbitmq.producer.AbstractProducer;
import org.springframework.stereotype.Component;

@Component
public class CourseProducer extends AbstractProducer {

    private static final String defaultExchange = ExchangeServiceHandler.COURSE_EXCHANGE;
    private static final String deadLetterExchange = "";

    @Override
    public String getExchange() {
        return defaultExchange;
    }

    @Override
    public String getDeadLetterExchange() {
        return deadLetterExchange;
    }

    /**
     * 订单完成 课程销量自增
     */
    public void increaseCourseSales(Long courseId){
        send("course.sales.increment",courseId);
    }
}
